package UIUtils
{
	public class uif_utilDate {
		
		public static const millisecondsPerMinute:int = 1000 * 60; 
		public static const millisecondsPerHour:int = 1000 * 60 * 60; 
		public static const millisecondsPerDay:int = 1000 * 60 * 60 * 24;
		
		public static function  mysqlDate(a_date: String, year: int=0): Date {
			var a: Array = a_date.split('-');
			return new Date(year?year:a[0], a[1] - 1, a[2]);
		}
		
		public static function addDay(a_date: Date, addDay: int): Date {
			var result: Date = new Date(a_date.getTime() + millisecondsPerDay * addDay);
			return result;
		}
		
		public static function toDNum(num: int): String {
			if (num < 10) return '0' + num;
			else return num.toString();
		}
	}
}